package com.dreamchaser.familydevice.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dreamchaser.familydevice.po.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author shajie
 * @since 2020-02-18
 */
public interface UserMapper extends BaseMapper<User> {


    /**
     * 注册
     *
     * @param user
     * @return
     */
    int insert(User user);

    /**
     * 登陆
     *
     * @param account
     * @param password
     * @return
     */
    @Select("select * from user b where b.account = #{account} and password = #{password}")
    User selectByUsernNameAndPwd(@Param("account") String account,@Param("password") String password);

    @Select("select * from user b where b.account = #{account}")
    String selectByUserName(String account);



    @Select("select * from user b where b.account = #{account}")
    User selectByAccount(String account);

}
